<!DOCTYPE html>
<html>

<head>
    <meta charset='utf-8'>
    <style>
        body {
            margin: 0;
        }
    </style>
</head>

<body>
    ...
    <script>
        const testData = JSON.parse(decodeURIComponent(location.hash.substring(1)));
        const script = testData.script;
        import(script).then(async Module => {
            try {
                const result = await Module.test();
                document.body.innerHTML = "ok";
                parent.postMessage(JSON.stringify({ script }), "*");
            } catch (error) {
                parent.postMessage(JSON.stringify({ script, error: { message: error.message, stack: error.stack } }), "*");
                throw error;
            }
        })
    </script>
</body>

</html>